Examples of Call Setup Rules

Below are configuration examples of Call Setup Rules.

Example 1: This example configures the device to replace (manipulate) the incoming call's source number with a number retrieved from the Microsoft Active Directory (AD) by an LDAP query. The device queries the AD server for the attribute record, "telephoneNumber" whose value is the same as the received source number (e.g., "telephoneNumber =4064"). If such an Attribute exists, the device retrieves the number of the attribute record, "alternateNumber" and uses this number as the source number.
Call Setup Rules Table:
'Rules Set ID': 1
'Request Type': LDAP
'Request Target': LDAP-DC-CORP
'Request Key': ‘telephoneNumber=’ + param.call.src.user
'Attributes to Get': alternateNumber
'Row Role': Use Current Condition
'Condition': ldap.attr.alternateNumber exists
'Action Subject': param.call.src.user
'Action Type': Modify
'Action Value': ldap.attr.alternateNumber
IP-to-IP Routing Table:
(Index 1) 'Call Setup Rules Set ID' or 'Pre Route Call Setup Rules Set ID': 1
Example 2: This example configures the device to replace (manipulate) the incoming call's calling name (caller ID) with a name retrieved from the AD by an LDAP query. The device queries the AD server for the attribute record "telephoneNumber" whose value is the same as the received source number (e.g., "telephoneNumber =5098"). If such an attribute is found, the device retrieves the name from the attribute record "displayName" and uses it as the calling name of the incoming call.
Call Setup Rules Table:
'Rules Set ID': 2
'Request Type': LDAP
'Request Target': LDAP-DC-CORP
'Request Key': ‘telephoneNumber=’ + param.call.src.user
'Attributes to Get': displayName
'Row Role': Use Current Condition
'Condition': ldap.attr.displayName exists
'Action Subject': param.call.src.name
'Action Type': Modify
'Action Value': ldap.attr.displayName
IP-to-IP Routing table: A single routing rule is assigned the Call Setup Rule Set ID.
(Index 1) 'Call Setup Rules Set ID' or 'Pre Route Call Setup Rules Set ID': 2
Example 3: This example configures the device to route the incoming call according to whether or not the source number of the incoming call also exists in the AD server. The device queries the AD server for the attribute record "telephoneNumber" whose value is the same as the received source number (e.g., telephoneNumber=4064"). If such an attribute is found, the device sends the call to Teams. If the query fails, the device sends the call to the PBX (i.e., alternative routing).
Call Setup Rules Table:
'Rules Set ID': 3
'Request Type': LDAP
'Request Target': LDAP-DC-CORP
'Request Key': ‘telephoneNumber=’ + param.call.src.user
'Attributes to Get': telephoneNumber
'Row Role': Use Current Condition
'Condition': ldap.found !exists
'Action Subject': -
'Action Type': Exit
'Action Value': False

If the attribute record is found (i.e., condition not met), the rule ends with a default exit result of "true" and uses the first routing rule (Teams). If the attribute record doesn't exist (i.e., condition met), the rule exits with a "false" result and uses the second routing rule (PBX).

IP-to-IP Routing Table: Two routing rules are assigned with the same matching characteristics. Only the main routing rule is assigned a Call Setup Rules Set ID.
'Index': 1
'Call Setup Rules Set ID' or 'Pre Route Call Setup Rules Set ID': 3
'Destination IP Group ID': 3 (IP Group for Teams)
'Index': 2
'Destination IP Group ID': 4 (IP Group for PBX)
Example 4: This example uses the msRTCSIP-DeploymentLocator AD attribute to determine if a user has migrated to Teams or not. If the LDAP query fails (attribute doesn't exist), the call fails and the device doesn't attempt (stops / aborts) to route the call, even if alternative routing rules exist.
Call Setup Rules Table:
'Rules Set ID': 1
'Request Type': LDAP
'Request Target': LDAP-DC-CORP
'Request Key': '(&(msRTCSIP-DeploymentLocator=SRV:)(msRTCSIP-Line=tel:'+param.call.dst.user+'*))'
'Attributes to Get': msRTCSIP-DeploymentLocator
'Row Role': Use Current Condition
'Condition': ldap.attr.msRTCSIP-DeploymentLocator !exists
'Action Type': Exit
'Action Value': Abort
IP-to-IP Routing table:
(Index 1) 'Call Setup Rules Set ID' or 'Pre Route Call Setup Rules Set ID': 1
Example 5: This example enables routing based on LDAP queries and destination tags for matching routing rules. The device queries the LDAP server for the attribute record "telephoneNumber" whose value is the destination number of the incoming call (e.g., "telephoneNumber=4064"). If the attribute-value combination is found, the device retrieves the string value of the attribute record "ofiSBCRouting" and creates a destination tag with the name of the retrieved string. The destination tag is then used as a matching characteristics in the IP-to-IP Routing table.
Call Setup Rules Table:
'Rules Set ID': 4
'Request Type': LDAP
'Request Target': LDAP-DC-CORP
'Request Key': 'telephoneNumber='+param.call.dst.user
'Attributes to Get': ofiSBCRouting
'Row Role': Use Current Condition
'Condition': ldap.found exists
'Action Subject': dsttags
'Action Type': Modify
'Action Value': ldap.attr.ofiSBCrouting
IP Groups Table: 'Call Setup Rules Set ID': 4
IP-to-IP Routing Table:
'Index': 1
'Destination Tag': dep-sales
'Destination IP Group': SALES
'Index': 2
'Destination Tag': dep-mkt
'Destination IP Group': MKT
'Index': 3
'Destination Tag': dep-rd
'Destination IP Group': RD
Example 6: This example enables routing based on LDAP queries and destination tags for matching destination IP Groups. The device queries the LDAP server for the attribute record "telephoneNumber" whose value is the destination number of the incoming call (e.g., "telephoneNumber=4064"). If the attribute-value combination is found, the device retrieves the string value of the attribute record "CountryOfResidence" and creates a destination tag with the name of the retrieved string. The value of the destination tag name is then used as a matching characteristics of the IP Group.
Call Setup Rules Table:
'Rules Set ID': 4
'Request Type': LDAP
'Request Target': LDAP-DC-CORP
'Request Key': 'telephoneNumber='+param.call.dst.user
'Attributes to Get': CountryOfResidence
'Row Role': Use Current Condition
'Condition': ldap.found exists
'Action Subject': DstTags.Country
'Action Type': Modify
'Action Value': ldap.attr.CountryOfResidence
IP Groups Table:
'Index': 1
'Tags': Country=UK
'Index': 2
'Tags': Country=FR
IP-to-IP Routing Table:
'Destination Type': Destination Tag
'Pre Route Call Setup Rules Set ID': 4
'Routing Tag Name': Country
Example 7: This example configures the device to run an ENUM query with an ENUM server to retrieve a SIP URI address for the called E.164 telephone number. The device then replaces (manipulates) the incoming call's E.164 destination number in the SIP Request-URI header with the URI retrieved from the ENUM server. The ENUM server's address is the address configured in the 'Primary DNS' parameter for the "ITSP-450" IP Interface in the IP Interfaces table.
Call Setup Rules Table:
'Index': 0
'Rules Set ID': 4
'Request Type': ENUM
'Request Target': ITSP-450
'Request Key': param.call.dst.user
'Condition': enum.found exists
'Action Subject': header.request-uri.url
'Action Type': Modify
'Action Value': enum.result.url
IP Groups Table:
'Call Setup Rules Set ID': 4
Example 8: For an example on HTTP GET operations, see Configuring an HTTP GET Web Service.
Example 9: For an example on HTTP POST (notification) operations, see Configuring HTTP POST Web Service.